Heap Memory Management in Prolog with Tabling: Principles and Practice
نویسندگان
چکیده
We address memory management aspects of WAM-based logic programming systems that support tabled evaluation through the use of a suspension/resumption mechanism. We describe the memory organization and usefulness logic of such systems, and issues that have to be resolved for effective and efficient garbage collection. Special attention is given to early reset in the context of suspended computations and to what is involved in the implementation of a segment order preserving copying collector for a tabled Prolog system. We also report our experience from building two working heap garbage collectors (one mark&slide and one mark©) for the XSB system on top of a CHAT-based tabled abstract machine: we discuss general implementation choices for heap garbage collection in ‘plain’ WAM and issues that are specific to WAM with tabling. Finally, we compare the performance of our collectors with those of other Prolog systems and extensively analyze their characteristics. Thus, this article documents our own implementation and serves as guidance to anyone interested in proper memory management of tabled systems or systems that are similar in certain aspects.
منابع مشابه
Heap Garbage Collection in XSB: Practice and Experience
Starting from a theoretical understanding of the issues involved in the implementation of a heap garbage collector in a logic programming system with built-in tabling, and from an actual collector that did not take tabling (i.e. suspended computations) into account we have build two working heap garbage collectors (one mark&slide, one mark©) for XSB on top of a CHAT implementation model for...
متن کاملCAT: The Copying Approach to Tabling
The SLG-WAM implements tabling by freezing the WAM stacks: this implementationtechnique has a reasonably small execution overhead , but is not easy to implement on top of an existing Prolog system. We here propose a new approach to the implementation of tabling: the Copying Approach to Tabling. CAT interferes absolutely not with normal Prolog execution and can be introduced in an existing Prolo...
متن کاملIntegrated Symbol, Engine Table and Heap Memory Management in Multi-Engine Prolog
We describe an integrated solution to symbol, heap and logic engine memory management in a context where exchanges of arbitrary Prolog terms occur between multiple dynamically created engines, implemented in a new Java-based experimental Prolog system. As our symbols represent not just Prolog atoms, but also handles to Java objects (including arbitrary size integers and decimals), everything is...
متن کاملCAT : the Copying Approach to
The SLG-WAM can be characterized as a sharing approach to implementing tabling: the execution environments of suspended computations are intersperced in the WAM stacks. Stacks are frozen using a set of freeze registers and the WAM trail mechanism is extended so that the suspended computations can be resumed. This technique has a reasonably small execution overhead, but is not easy to implement ...
متن کاملImplementation of Tag Representation in Prolog Virtual Machine
Even if it is understood that Prolog execution environment performs dynamic type checking on data being processed, it is often unclear how implementation of the language internally represents the information used to verify the type compatibility. In this paper we describe a Prolog tag encoding mechanism used in the Logic Virtual Machine (LVM) implementation of Prolog. The LVM is a Prolog engine...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Journal of Functional and Logic Programming
دوره 2001 شماره
صفحات -
تاریخ انتشار 2001